
// CircuitObjView.h : interface of the CCircuitObjView class
//

#pragma once
#include "CHoopsView.h"
#include "HCircuitModel.h"

class CCircuitObjDoc;

class CCircuitObjView : public CHoopsView
{
protected: // create from serialization only
	CCircuitObjView();
	DECLARE_DYNCREATE(CCircuitObjView)

	// Attributes
protected:
	HCircuitModel *m_pHoopsModel;
public:
	CCircuitObjDoc* GetDocument() const;
	HCircuitModel *GetHoopsModel() { return m_pHoopsModel;}
	void SetHoopsModel(HCircuitModel*pModel) { m_pHoopsModel = pModel;}


	void DrawView(CDC* pDC,CSize &size);
	void RenderCircuit( CICircuitDisObj *pCircuit );

// Overrides
public:	
	virtual void Init();  
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	void ZoomCamera(double zoom_factor);
	void SetWindowColor(COLORREF new_top_color, COLORREF new_bottom_color, bool emit_message = true);
protected:
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
	void SetupOutputOptions(HOutputHandlerOptions & options, /*HOutputHandlerStyle*/ int style);

// Implementation
public:
	virtual ~CCircuitObjView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	afx_msg void OnCancelEditSrvr();
	afx_msg void OnFilePrintPreview();
	afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
	DECLARE_MESSAGE_MAP()
public:
	virtual void OnInitialUpdate();
	afx_msg void OnFileImport();
	afx_msg void OnUpdateFileImport(CCmdUI *pCmdUI);
	afx_msg void OnFileOutput();
};

#ifndef _DEBUG  // debug version in CircuitObjView.cpp
inline CCircuitObjDoc* CCircuitObjView::GetDocument() const
   { return reinterpret_cast<CCircuitObjDoc*>(m_pDocument); }
#endif

